import Request from "@/utils/requset.js";
let request = new Request().http;

//全局定义请求头
export default {
	// 发布闲置
	postmjtisell: function(data) {
		// console.log(data)
		return request({
			url: "/api/mjtisell",
			method: "post",
			data,
		});
	},
	// 发布话题
	postlfytopic: function(data) {
		return request({
			url: "/api/lfytopic",
			method: "post",
			data,
		});
	},
	// 修改密码
	gutRegister: function(data) {
		return request({
			url: `/api/whjregister/${data.id}`,
			method: 'put',
			data
		})
	},
	// 设置
	// 消息设置
	getmjtMessage: function() {
		return request({
			url: "/api/mjtmessage",
			method: "GET",
		});
	},
	gutMessageState: function(data) {
		return request({
			url: `/api/mjtmessage/${data.id}`,
			method: "put",
			data: data,
		});
	},
	// 自动回复
	getReply: function() {
		return request({
			url: "/api/mjtreply",
			method: "GET",
		});
	},
	gutReplyState: function(data) {
		return request({
			url: `/api/mjtreply/${data.id}`,
			method: "put",
			data: data,
		});
	},
	gutReplyContent: function(data) {
		return request({
			url: `/api/mjtreply/${data.id}`,
			method: "put",
			data: data,
		});
	},
	// 系统权限
	getSystem: function() {
		return request({
			url: "/api/mjtsystem",
			method: "GET",
		});
	},
	// 获取选择分类数据
	getpsxcatList: function(data) {
		return request({
			url: "/api/psxcation", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	gutSystemState: function(data) {
		return request({
			url: `/api/mjtsystem/${data.id}`,
			method: "put",
			data: data,
		});
	},
	// 我的(主页渲染)
	getTcygUserId: function(userId) {
		return request({
			url: `/api/mjttcyg/${userId}`,
			method: "GET",
		});
	},
	postTcyg: function(data) {
		return request({
			url: "/api/mjttcyg",
			method: "post",
			data,
		});
	},
	putTcyg: function(data) {
		return request({
			url: `/api/mjttcyg/${data.id}`,
			method: "put",
			data,
		});
	},
	// 我的(主页渲染) 我卖的
	getISellUserId: function(userId) {
		return request({
			url: `/api/mjtisell/${userId}`,
			method: "GET",
		});
	},
	// 我的(详情页) 评论
	getCommentUserId: function(userId) {
		return request({
			url: `/api/mjtcomment/${userId}`,
			method: "GET",
		});
	},
	// 我的(主页渲染) 我买的
	getIBoughtIt: function() {
		return request({
			url: "/api/mjtiboughtit",
			method: "GET",
		});
	},
	getIBoughtItShopState: function(shopState) {
		return request({
			url: `/api/mjtiboughtit/shopState/${shopState}`,
			method: "GET",
		});
	},
	getIBoughtItUserId: function(userId) {
		return request({
			url: `/api/mjtiboughtit/userId/${userId}`,
			method: "GET",
		});
	},
	putIBoughtIt: function(data) {
		return request({
			url: `/api/mjtiboughtit/${data.id}`,
			method: "put",
			data,
		});
	},
	// 别人(主页渲染) 下面选项
	getOthertUserId: function(userId) {
		return request({
			url: `/api/mjtother/${userId}`,
			method: "GET",
		});
	},
	lfygoods: function(data) {
		return request({
			url: "/api/lfygoods", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},

	searchGoods: function(data) {
		return request({
			url: `/api/lfygoods/${data.id}`,
			method: "GET",
			data: data,
		});
	},

	lfymessage: function(data) {
		return request({
			url: "/api/lfymessage", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},

	lfytopic: function(data) {
		return request({
			url: "/api/lfytopic", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	searchTopic: function(data) {
		return request({
			url: `/api/lfytopic/${data.id}`,
			method: "GET",
			data: data,
		});
	},

	lfypublic: function(data) {
		return request({
			url: "/api/lfypublic", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},

	searchNews: function(data) {
		return request({
			url: `/api/lfypublic/${data.id}`,
			method: "GET",
			data: data,
		});
	},
	lfynewsmess: function(data) {
		return request({
			url: "/api/lfynewsmess", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	// 发布评论
	addMessage: function(data) {
		return request({
			url: "/api/addlfymess",
			method: "POST",
			data: data,
		});
	},

searchLfyMess: function(data) {
   return request({
    url: `/api/searchlfymess/${data.judge}`,
    method: 'GET',
    data: data,
   })
  },
	
	// 淘货-点赞
	upGoods: function(data) {
		return request({
			url: `/api/lfygoodsup/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 淘货-详情
	// 关注
	upFollow: function(data) {
		return request({
			url: `/api/lfygoods/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 评论点赞
	upMessage: function(data) {
		return request({
			url: `/api/lfymessage/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 发布评论
	addGoodsMess: function(data) {
		return request({
			url: "/api/lfymessage",
			method: "POST",
			data: data,
		});
	},

	// 话题-点赞
	upTopic: function(data) {
		return request({
			url: `/api/lfytopicup/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 话题-详情
	// 关注
	upTFollow: function(data) {
		return request({
			url: `/api/lfytopic/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 评论点赞
	upTMessage: function(data) {
		return request({
			url: `/api/lfyTmessage/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 发布评论
	addTMessage: function(data) {
		return request({
			url: "/api/lfyTmessage",
			method: "POST",
			data: data,
		});
	},

	// 公益-点赞
	upPublic: function(data) {
		return request({
			url: `/api/lfypublicup/${data.id}`,
			method: "PUT",
			data: data,
		});
	},

	// 公益-详情
	// 评论点赞
	upPMessage: function(data) {
		return request({
			url: `/api/lfyPmessage/${data.id}`,
			method: "PUT",
			data: data,
		});
	},

	// 请求样式
	// 获取
	getMsg: function(data) {
		return request({
			url: "/api/findschool", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	// 删除
	delMsg: function(data) {
		return request({
			url: `/api/delschool/${data.id}`,
			method: "DELETE",
			data: data,
		});
	},
	// 添加
	addMsg: function(data) {
		return request({
			url: "/api/addschool",
			method: "POST",
			data: data,
		});
	},
	// 更新
	upMsg: function(data) {
		return request({
			url: `/api/xgschool/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 查找
	searchMsg: function(data) {
		return request({
			url: `/api/school/${data.id}`,
			method: "GET",
			data: data,
		});
	},
	getList: function(data) {
		return request({
			url: "/api/getWYLuser", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	//  图片上传
	psxloadimg: function(data) {
		console.log(data);
		return request({
			url: "/api/psxloadimg",
			method: "POST",
			data: data,
		});
	},
	// 发布话题
	addpsxtopic: function(data) {
		// console.log(data);
		return request({
			url: "/api/addpsxtopic",
			method: "POST",
			data: data,
		});
	},
	// // 上传分类
	// lwzBranch:function(data){
	// 	return request({
	// 		url: "/api/lwzBranch", //请求头
	// 		method: "GET", //请求方式
	// 		data: data, //请求数据
	// 	})
	// },
	// 发布闲置商品 图片上传
	addpsxidle: function(data) {
		console.log(data);
		return request({
			url: "/api/addpsxidle",
			method: "POST",
			data: data,
		});
	},
	// // 消息上传
	// lwzchat:function(data){
	// 	return request({
	// 		url:"/api/chat",
	// 		method:'POST',
	// 		data:data
	// 	})
	// },
	// 广场消息
	getpsxnews: function(data) {
		return request({
			url: "/api/psxnews",
			method: "GET",
			data: data,
		});
	},
	// 交易消息
	psxcontacts: function(data) {
		return request({
			url: "/api/psxcontacts",
			method: "GET",
			data: data,
		});
	},
	// 发布话题 图片上传
	lwzLoadImg: function(data) {
		console.log(data);
		return request({
			url: "/api/loadImg",
			method: "POST",
			data: data,
		});
	},
	// 上传分类
	lwzBranch: function(data) {
		return request({
			url: "/api/lwzBranch", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	// 发布闲置商品 图片上传
	lwzShopping: function(data) {
		console.log(data);
		return request({
			url: "/api/lwzShopping",
			method: "POST",
			data: data,
		});
	},
	// 消息上传
	lwzchat: function(data) {
		return request({
			url: "/api/chat",
			method: "POST",
			data: data,
		});
	},
	lwzmsgchat: function(data) {
		return request({
			url: "/api/chat",
			method: "GET",
			data: data,
		});
	},

	// 请求样式
	// 获取
	getMsg: function(data) {
		return request({
			url: "/api/findschool", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	// 删除
	delMsg: function(data) {
		return request({
			url: `/api/delschool/${data.id}`,
			method: "DELETE",
			data: data,
		});
	},
	// 添加
	addMsg: function(data) {
		return request({
			url: "/api/addschool",
			method: "POST",
			data: data,
		});
	},
	// 更新
	upMsg: function(data) {
		return request({
			url: `/api/xgschool/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	// 查找
	searchMsg: function(data) {
		return request({
			url: `/api/school/${data.id}`,
			method: "GET",
			data: data,
		});
	},
	adduser: function(data) {
		return request({
			url: "/api/addUser",
			method: "POST",
			data: data,
		});
	},
	getUser: function(data) {
		return request({
			url: "/api/getuser", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},

	searchUser: function(data) {
		return request({
			url: `/api/getusers/${data.username}`,
			method: "GET",
			data: data,
		});
	},
	login: function(data) {
		return request({
			url: `/api/login`,
			method: "POST",
			data: data,
		});
	},
	getShopList: function(data) {
		return request({
			url: "/api/getshopList", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	getfenleiList: function(data) {
		return request({
			url: "/api/getfenlei", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},

	searchshop: function(data) {
		return request({
			url: `/api/getshop/${data.id}`,
			method: "GET",
			data: data,
		});
	},
	getMessage: function() {
		return request({
			url: "/api/getmessage", //请求头
			method: "GET", //请求方式
		});
	},
	upshopList: function(data) {
		return request({
			url: `/api/upshopList/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	upMess: function(data) {
		return request({
			url: `/api/upmess/${data.id}`,
			method: "PUT",
			data: data,
		});
	},
	addMess: function(data) {
		return request({
			url: "/api/addmess",
			method: "POST",
			data: data,
		});
	},
	searchFen: function(data) {
		return request({
			url: `/api/sefenlei/${data.id}`,
			method: "GET",
			data: data,
		});
	},
	getTag: function(data) {
		return request({
			url: "/api/gettage", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	searchShop: function(data) {
		console.log(data);
		return request({
			url: `/api/searchshop/${data}`,
			method: "GET",
			data: data,
		});
	},

	getTopic: function(data) {
		return request({
			url: "/api/gettopic", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		});
	},
	searchMes: function(data) {
	   return request({
	    url: `/api/searchmess/${data.judge}`,
	    method: 'GET',
	    data: data,
	   })
	  },
	searchtopic: function(data) {
		return request({
			url: `/api/gettopic/${data.id}`,
			method: "GET",
			data: data,
		});
		
	},
};
